package com.greensam.pixelengine.pojo.entity;

import com.greensam.pixelengine.pojo.base.BaseEntity;
import com.greensam.pixelengine.pojo.emuns.GenderEnum;
import com.greensam.pixelengine.pojo.emuns.StatusEnum;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.hibernate.annotations.Comment;

/**
 * @author Macro_Ray
 * @since 2025/6/16 17:11
 */
@Getter
@Setter
@Entity
@Accessors(chain = true)
@Table(name = "user_info", indexes = {
        @Index(name = "uk_account", columnList = "account", unique = true),
        @Index(name = "idx_name", columnList = "name")
})
@Comment("用户信息表")
public class UserPo extends BaseEntity {

    @Column(nullable = false, length = 128)
    @Comment("账号")
    private String account;

    @Column(nullable = false, length = 128)
    @Comment("密码")
    private String password;

    @Column(nullable = false, length = 128)
    @Comment("用户名")
    private String name;

    @Comment("性别")
    @Enumerated(value = EnumType.ORDINAL)
    private GenderEnum gender;

    @Column(columnDefinition = "TEXT")
    @Comment("头像")
    private String avatar;

    @Column(columnDefinition = "TEXT")
    @Comment("简介")
    private String profile;

    @Column(length = 256)
    @Comment("邮箱")
    private String email;

    @Column(length = 32)
    @Comment("手机号")
    private String phone;

    @Comment("状态")
    @Enumerated(value = EnumType.STRING)
    private StatusEnum status;

}
